package top.kaoshanji.ch03;

import com.google.inject.Inject;
import top.kaoshanji.ch03.beans.Agent;
import top.kaoshanji.ch03.beans.AgentFinder;

import java.util.List;

/**
 * author kaoshanji
 * ^_^
 * create time 2024/12/14 18:19
 */
public class HollywoodServiceGuice {

    private AgentFinder finder = null;

    @Inject
    public HollywoodServiceGuice(AgentFinder agentFinder) {
        this.finder = agentFinder;
    }

    public List<Agent> getFriendlyAgents() {

        List<Agent> agents = finder.findAllAgents();
        return HollywoodFilter.filterAgents(agents, "Java Developers");

    }


}
